'use strict';
const Service = require('egg').Service;

class Leaderboard extends Service {
    /**
     * @params {}
     * @bussiness {分类排行榜}
     * @author JC
     * @date 2022-08-15
     * **/
    async getLeaderboard() {
        try {
            // 防sql注入
            const result_man = await this.app.mysql.select('novels_man_leaderboard')
            const result_woman = await this.app.mysql.select('novels_woman_leaderboard')
            return {
                result_man,
                result_woman
            }
        } catch (e) {
            return new Error("error")
        }
    }
    /**
     * @params {}
     * @bussiness {分类小说}
     * @author JC
     * @date 2022-08-15
     * **/
    async getNovelsList(){
        try {
            let novels = await this.app.mysql.select('novels')
            return novels
        }catch(e) {
            return new Error("error")
        }
    }
}
module.exports = Leaderboard;